var fs=require("fs");
var zlib=require("zlib");

//压缩input.y=txt文件input.txt,gz
fs.createReadStream("index.txt")
.pipe(zlib.createGzip())
.pipe(fs.createWriteStream("index.txt.gz"));

console.log("文件压缩完成。");
